package com.itheima.wms.controller;

import com.itheima.wms.service.GetCodeFactoryService;
import com.itheima.wms.utils.Result;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequiredArgsConstructor
@RequestMapping(path = "/codeFactory/next")
public class GetCodeFactoryController {
    private final GetCodeFactoryService getCodeFactoryService;

    @GetMapping(path = "/{type}")
    public Result<String> getCodeFactory(@PathVariable String type) {
        String code=getCodeFactoryService.getCodeFactory(type);
        return Result.success(code);
    }
}
